import React from 'react'

import PropTypes from 'prop-types'

export default class Head extends React.Component {
  constructor(props) {
    super(props)
    this.state = {}
  }

  render() {
    return (
      <div>
        {this.props.title}
      </div>
    )
  }
}

// https://react.docschina.org/docs/typechecking-with-proptypes.html

// PropTypes 验证器
Head.propTypes = {
  title: PropTypes.string,
  // https://react.docschina.org/blog/2017/04/07/react-v15.5.0.html#migrating-from-reactproptypes
  // name: PropTypes.string.isRequired, // 封装组件 - 可能会用
}

// 默认 Prop 值
Head.defaultProps = {
  title: 'head 没有值哦',
}